package com.atguigu.study.controller;

import dev.langchain4j.model.chat.ChatModel;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Marco
 * @Description
 * @date 2025/8/16 18:28
 * @email 3293336923@qq.com
 */
@Slf4j
@RestController
public class MultiModelController {


    @Autowired
    private ChatModel   qwen;

    @Autowired
    private  ChatModel  deepseek;


    @GetMapping("multi/model/qwen")
    public    String    qwAnswer(@RequestParam(value = "prompt" , defaultValue = "你是谁?")  String    prompt){

        String result = qwen.chat(prompt);
        log.info("通过langchain4j调用qwen大模型返回结果:{}", result);
        return   result;
    }

    @GetMapping("multi/model/deepseek")
    public     String     deepSeekAnswer(@RequestParam(name = "prompt", defaultValue = "你是谁?") String   prompt){

        String result = deepseek.chat(prompt);
        log.info("通过 langchain4j调用deepseek模型:{}",result);
        return  result;
    }


}
